#!/bin/bash

# 获取包含 electron 的进程列表
pid_list=$(ps -A | grep "MacOS/Electron" | awk '{print $1}')

echo $pid_list

# 获取第一个匹配到的进程PID
#first_pid=$(echo "$pid_list" | head -n 1)
first_pid=$(echo "$pid_list" | awk 'NR==2{print}')


if [ -n "$first_pid" ]; then
    # 杀死进程
    echo "Killing Electron process with PID: $first_pid"
    kill -9 "$first_pid"
else
    echo "No Electron process found."
fi
ps -A | grep "MacOS/Electron"
